package beans;

import javax.servlet.http.HttpServletRequest;

//import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.upload.FormFile;

public class BackupRestoreForm extends org.apache.struts.action.ActionForm 
{
	private FormFile file;
    public FormFile getFile() 
    {
		return file;
	}

	public void setFile(FormFile file) 
	{
		this.file = file;
	}

    public BackupRestoreForm () 
    {
    
    }

    public void reset(ActionMapping actionMapping, HttpServletRequest request) 
    {
 
    }

    public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest request)
    {
    	ActionErrors errors = new ActionErrors();
    	try{
    	if (file.getFileSize() == 0)
    	{
    		errors.add("errors", new ActionMessage("No File Choosed"));
    	}
    	}
    	catch(Exception e){}
    	return errors;
    }


}